package com.elf.bluetoothtest.activity;

import android.widget.Toast;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

/**
 * activity 基类
 * Created by Lidong on 2017/11/7.
 */
public abstract class BaseActivity extends AppCompatActivity {

    private final static String TAG = BaseActivity.class.getSimpleName();

    protected void showToast(final String msg) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(BaseActivity.this, msg, Toast.LENGTH_SHORT).show();
            }
        });
    }

    protected void showDialog(String msg){
        new AlertDialog.Builder(this)
                .setMessage(msg)
                .setPositiveButton("确定", null)
                .show();
    }
}
